package FSPackage;

import jade.core.ProfileImpl;
import jade.core.Runtime;
import jade.wrapper.*;

/**
 *
 * 
 */
public class FS {
    public static void main(String[] args) {
        String arg = (args.length < 1) ? null : args[0];

        Runtime runtime = Runtime.instance();
        ProfileImpl p = new ProfileImpl();

        p.setParameter(p.MAIN_HOST, "192.168.0.100");
        p.setParameter(p.LOCAL_HOST, "192.168.0.100");
        p.setParameter(p.CONTAINER_NAME, arg);

        ContainerController container = runtime.createAgentContainer(p);
        AgentController ac = null;

        FSAgent FSA = new FSAgent();
        Object[] argument = new Object[2];
        argument[0] = FSA.getAID();

        try {
            ac = container.createNewAgent(arg, FSAgent.class.getName(), argument);
            ac.start();
        } catch (Exception e) {
            System.err.println("Problem creating new agent");
        }
    }
}
